package com.mcxx.modules.miniSalvation.order.service.write;

import com.mcxx.modules.miniSalvation.order.dao.write.IncomeCalculateWriteDao;
import com.mcxx.modules.miniSalvation.order.entity.IncomeCalculate;
import com.yinhai.ta404.core.transaction.annotation.TaTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
@TaTransactional
public class IncomeCalculateWriteService{
    @Autowired
    private IncomeCalculateWriteDao incomeCalculateWriteDao;
    @Autowired
    private IncomeCertWriteService incomeCertWriteService;

    public int insert(IncomeCalculate entity){
        return incomeCalculateWriteDao.insert(entity);
    }

    public int insertIgnoreNull(IncomeCalculate incomeCalculate){
        return incomeCalculateWriteDao.insertIgnoreNull(incomeCalculate);
    }



   public  int updateIgnoreNull(IncomeCalculate incomeCalculate){
       return incomeCalculateWriteDao.updateIgnoreNull(incomeCalculate);
   }

   public void backupCalculate(String orderId,String newOrderId){

       incomeCalculateWriteDao.insertCopy(orderId,newOrderId);

       incomeCertWriteService.insertCopy(orderId,newOrderId);
   }

}
